﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Add.aspx.cs" Inherits="LabMS.Web.Role.Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>添加用户角色</title>
    <link type="text/css" rel="stylesheet" href="../style/screen.css" />
    <!--[if lte IE 6]>
    <link type="text/css" rel="stylesheet" href="../style/ie6.css" />
    <![endif]-->
    <!--[if lte IE 7]>
    <link type="text/css" rel="stylesheet" href="../style/ie7.css" />
    <![endif]-->
    <style type="text/css">
        ul.plate {
            font-size: 18px;
        }
        ul.plate li {
            padding: 3px 0px;
            margin-left: 15px;
        }
        ul.module {
            font-size: 14px;
            border-bottom: dashed 1px #0099cc; 
        }
        ul.module li div {
            margin-left: 20px;
           font-size: 12px; 
        }
   </style>
</head>
<body class="mainBody">
    <form id="form1" runat="server">
        <div class="main">
            <div id="pageInfo" class="clearfix">
                <div class="title">
                    <label>
                        <a href="RoleList.aspx">角色管理</a>
                    </label>
                    &gt;
                    <label>
                        新增角色</label>
                </div>
            </div>
        </div>
        <div class="main">
            <p>
                <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" CssClass="button" />
                <input id="backbtn" type="button" class="button" runat="server" onclick="javascript:window.location.href='RoleList.aspx'"
                    value="返回" />
            </p>
            <table border="0" cellpadding="4" cellspacing="0">
                <tr>
                    <td>
                        <label class="itemTitle">
                            角 色 名：</label></td>
                    <td>
                        <asp:TextBox ID="tbRoleName" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>
                        <label class="itemTitle">
                            角色描述：</label></td>
                    <td>
                        <asp:TextBox ID="tbRoleDetails" runat="server" TextMode="MultiLine" Rows="5" Columns="10"
                            Height="127px" Width="248px"></asp:TextBox></td>
                </tr>
            </table>
        </div>
        <asp:Panel ID="PRolePrivaily" runat="server" Width="100%">
            角色权限
        </asp:Panel>
        <asp:Label ID="lbErr" ForeColor="red" Visible="false" runat="server" Text=""></asp:Label>
    </form>

    <script type="text/javascript" src="../js/Common.js"></script>

    <script type="text/javascript" src="../js/jQuery/jquery-1.3.1.js"></script>

    <script type="text/javascript" src="../js/jQuery/jquery.tooltip.js"></script>

    <script type="text/javascript" src="../js/jQuery/jquery.bgiframe.js"></script>

    <script type="text/javascript" src="../js/jQuery/jquery.validate.js"></script>

    <script type="text/javascript" src="../js/site.js"></script>

    <script type="text/javascript">
    $("#uiForm").validate({
        rules:{
                tbRoleName:{
                        required:true,
                        maxlength:50
                    },
                tbRoleDetails:{
                    required:true
                    }
                },
            messages:{
                tbRoleName:{
                    required:"请输入角色名称",
                    maxlength:"角色名称长度不能超过50！"
                            },
                tbRoleDetails:{
                    required:"请输入角色描述"
                               }
                    }
    });
   
    function checkAllChanged(trigger, targetAreaId)
    {
        var mchk = document.getElementById(trigger); 
	    var targetArea = document.getElementById(targetAreaId);
	    var checkboxes = [];
	    checkboxes = targetArea.getElementsByTagName("input");
	    for (var i = checkboxes.length - 1; i > -1; i--)
	    {
		    if (checkboxes[i].type == "checkbox")
		    {
			    checkboxes[i].checked = mchk.checked;
		    }
	    }
    }
   
   function checkFunctionChanged(modulechk, targetAreaId)
  {
        var mchk = document.getElementById(modulechk);
        var allcheck = false;
         var targetArea = document.getElementById(targetAreaId);
        var checkboxes = [];
	    checkboxes = targetArea.getElementsByTagName("input");
        for (var i = checkboxes.length - 1; i > -1; i--)
	    {
		    if (checkboxes[i].type == "checkbox")
		    {
			    if(checkboxes[i].checked)
			    {
			        allcheck = true;
			    }
			    else
			    {
			        mchk.checked = false;
			       return; 
			    }
		    }
	    }
	    if(allcheck)
	    {
	        mchk.checked = true;
	    }
  } 
    
    </script>

</body>
</html>
